package com.summer.framework.api.feign.factory.admin;

import com.summer.framework.api.feign.fallback.admin.UserApiServiceFallBack;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @auther: 杨杰
 * @date: 2019/5/13 14:10
 * @description:
 */
@Component
@Slf4j
public class UserApiServiceFactory implements FallbackFactory<UserApiServiceFallBack> {

    @Override
    public UserApiServiceFallBack create(Throwable throwable) {
        UserApiServiceFallBack fallBack = new UserApiServiceFallBack();
        fallBack.setCause(throwable);
        return fallBack;
    }
}
